{extend name="common/menu_child" /}

{block name="nav"}
<span class="layui-breadcrumb">
	<a>资源回收</a>
	<a><cite>工作人员</cite></a>
</span>
{/block}

{block name="body"}
<div class="layui-row">
	<form class="layui-form layui-col-md12 x-so">
		<input class="layui-input" placeholder="姓名" name="realname" value="{$condition.realname}" autocomplete="off" />
		<input style="display:none;" name="p" value="1" />
		<button class="layui-btn"><i class="layui-icon">&#xe615;</i></button>
		<!-- <a class="layui-btn layui-btn-normal" style="margin-left:0px;" href="{:url('create')}">添加</a> -->
	</form>
</div>
<table class="layui-table">
	<thead>
		<tr>
			<th>序号</th>
			<th>姓名</th>
			<th>联系电话</th>
			<th>订单总量</th>
			<th>添加时间</th>
			<th>是否禁用</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		{eq name="data_list|count" value="0"}
			<tr>
				<td colspan="20">暂无数据</td>
			</tr>
		{else/}
			{foreach name="data_list" item="vo" key="ko"}
			<tr>
				<td>{$ko + 1}</td>
				<td>{$vo.realname}</td>
				<td>{$vo.phone}</td>
				<td>{$vo.order_number}&nbsp;单</td>
				<td>{$vo.create_time|date='Y-m-d H:i:s',###}</td>
				<td>{eq name="vo.is_disable" value="0"}正常{else/}已禁用{/eq}</td>
				<td class="td-manage">
					<a title="编辑地区" data-id="{$vo.id}" href="{:url('edit_region', array('staff_id' => $vo['id']))}">
						<i class="layui-icon" style="font-size:18px;">&#xe630;</i>
					</a>
					<a title="删除" bind-name="del" data-id="{$vo.id}" href="javascript:void(0);">
						<i class="layui-icon" style="font-size:18px;">&#xe640;</i>
					</a>
				</td>
			</tr>
			{/foreach}
		{/eq}
	</tbody>
</table>

<div class="page">{$page}</div>
{/block}

{block name="javascript"}
<script type="text/javascript">
	
	layui.use(['form', 'layer'], function(){
		
		/** 删除 */
		$('[bind-name=del]').on('click', function(e){
			layui.layer.confirm('是否确认删除', {}, function(){
				let data = {
					id: parseInt($(e.currentTarget).attr('data-id')),
				};
				action_post_json('del', data, function(response){
					layui.layer.msg(response.message);
					if(0 === response.errno){
						setTimeout(function(){
							window.location.reload();
						}, 1000)
					};
				});
			});
		});
		
	});
	
</script>
{/block}